package lanqiao;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class C电池分组 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = Integer.parseInt(sc.nextLine());
        ArrayList<int[]> list = new ArrayList<>();
        for (int i=0;i<t;i++) {
            int n = Integer.parseInt(sc.nextLine());
//            int[] test = new int[n];
            int[] test = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray();
            list.add(test);
        }
        getResult(t,list);

    }

    public static void getResult(int t,ArrayList<int[]> list) {
        for (int i=0;i<t;i++) {
            int[] test = list.get(i);
            int sum = 0;
            for (int x : test) {
                sum = sum^x;
            }
            if (sum==0) {
                System.out.println("YES");
            } else {
                System.out.println("NO");
            }
        }
    }
}
